home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / misc / Hunk.lha / Hunk / Hoppers / OberonII_30.hop < prev    next >
Text File  |  1998-02-14  |  5KB  |  118 lines

  1. ;*************************************************************************
  2. ;** Oberon-II 3.0                                                       **
  3. ;** Contributor: L.Lucius                               Sept 23rd 1995  **
  4. ;** Modified for HOp:   Thomas Richter  (thor)          Nov  1st  1997  **
  5. ;** Function:    Modify 68000 math routines to use 68020+ instructions. **
  6. ;*************************************************************************
  7.  
  8.  
  9.  
  10. ;*************************************************************************
  11. ;
  12. ; DIV
  13. ;
  14. #match
  15. #code
  16. 48E7 3C00                       ;   MOVEM.L     D2-D5,-(A7)
  17. 2800                            ;   MOVE.L      D0,D4
  18. 6A02                            ;   BPL.B       000A
  19. 4480                            ;   NEG.L       D0
  20. 2A01                            ;   MOVE.L      D1,D5
  21. 6A02                            ;   BPL.B       0010
  22. 4481                            ;   NEG.L       D1
  23. 0C81 0000 FFFF                  ;   CMPI.L      #0000FFFF,D1
  24. 621A                            ;   BHI.B       0032
  25. 3601                            ;   MOVE.W      D1,D3
  26. 3400                            ;   MOVE.W      D0,D2
  27. 4240                            ;   CLR.W       D0
  28. 4840                            ;   SWAP        D0
  29. 80C3                            ;   DIVU.W      D3,D0
  30. 2200                            ;   MOVE.L      D0,D1
  31. 4840                            ;   SWAP        D0
  32. 3202                            ;   MOVE.W      D2,D1
  33. 82C3                            ;   DIVU.W      D3,D1
  34. 3001                            ;   MOVE.W      D1,D0
  35. 4241                            ;   CLR.W       D1
  36. 4841                            ;   SWAP        D1
  37. 601E                            ;   BRA.B       0050
  38. 2601                            ;   MOVE.L      D1,D3
  39. 2200                            ;   MOVE.L      D0,D1
  40. 4241                            ;   CLR.W       D1
  41. 4841                            ;   SWAP        D1
  42. 4840                            ;   SWAP        D0
  43. 4240                            ;   CLR.W       D0
  44. 740F                            ;   MOVEQ       #0F,D2
  45. D080                            ;   ADD.L       D0,D0
  46. D381                            ;   ADDX.L      D1,D1
  47. B681                            ;   CMP.L       D1,D3
  48. 6204                            ;   BHI.B       004C
  49. 9283                            ;   SUB.L       D3,D1
  50. 5240                            ;   ADDQ.W      #1,D0
  51. 51CA FFF2                       ;   DBF         D2,0040
  52. 4A84                            ;   TST.L       D4
  53. 6A02                            ;   BPL.B       0056
  54. 4481                            ;   NEG.L       D1
  55. BB84                            ;   EOR.L       D5,D4
  56. 6A0A                            ;   BPL.B       0064
  57. 4480                            ;   NEG.L       D0
  58. 4A81                            ;   TST.L       D1
  59. 6704                            ;   BEQ.B       0064
  60. 5380                            ;   SUBQ.L      #1,D0
  61. D285                            ;   ADD.L       D5,D1
  62. 4CDF 003C                       ;   MOVEM.L     (A7)+,D2-D5
  63. 4E75                            ;   RTS
  64. ;
  65. ;
  66. #replace
  67. 4C41 0801                       ;   DIVSL.L     D1,D1:D0
  68. 4E75                            ;   RTS
  69. #end
  70.  
  71.  
  72. ;*************************************************************************
  73. ;
  74. ; MUL
  75. ;
  76. #match
  77. #code
  78. 48E7 3000                       ;   MOVEM.L     D2-D3,-(A7)
  79. 4A80                            ;   TST.L       D0
  80. 5BC3                            ;   SMI         D3
  81. 6A02                            ;   BPL.B       000C
  82. 4480                            ;   NEG.L       D0
  83. 4A81                            ;   TST.L       D1
  84. 6A04                            ;   BPL.B       0014
  85. 4603                            ;   NOT.B       D3
  86. 4481                            ;   NEG.L       D1
  87. 4840                            ;   SWAP        D0
  88. 4841                            ;   SWAP        D1
  89. 4A40                            ;   TST.W       D0
  90. 670C                            ;   BEQ.B       0028
  91. 4A41                            ;   TST.W       D1
  92. 6706                            ;   BEQ.B       0026
  93. 003C 0002                       ;   ORI         #02,CCR
  94. 601C                            ;   BRA.B       0042
  95. C340                            ;   EXG         D1,D0
  96. 4840                            ;   SWAP        D0
  97. 3401                            ;   MOVE.W      D1,D2
  98. 4841                            ;   SWAP        D1
  99. C2C0                            ;   MULU.W      D0,D1
  100. C0C2                            ;   MULU.W      D2,D0
  101. 4840                            ;   SWAP        D0
  102. 4A40                            ;   TST.W       D0
  103. 66E8                            ;   BNE.B       0020
  104. D081                            ;   ADD.L       D1,D0
  105. 6BE4                            ;   BMI.B       0020
  106. 4A03                            ;   TST.B       D3
  107. 6702                            ;   BEQ.B       0042
  108. 4480                            ;   NEG.L       D0
  109. 4CDF 000C                       ;   MOVEM.L     (A7)+,D2-D3
  110. 4E75                            ;   RTS
  111. ;
  112. ;
  113. #replace
  114. 4C01 0800                       ;   MULS.L      D1,D0
  115. 4E75                            ;   RTS
  116. #end
  117.  
  118.